package com.gugee.ins.common.dal.service.statistics.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gugee.ins.common.dal.mapper.statistics.InsStProductBaseMapper;
import com.gugee.ins.common.dal.service.statistics.InsStProductBaseDao;
import com.gugee.ins.common.model.mysql.statistics.InsStProductBase;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


/**
 * <p>
 * ins商品统计表 dao impl
 * </p>
 *
 * @author HuangXin
 * @since 2021-01-06
 */
@Slf4j
@Service
public class InsStProductBaseDaoImpl extends ServiceImpl<InsStProductBaseMapper, InsStProductBase> implements InsStProductBaseDao {

    /**
     * 根据productId查找
     * @param productId
     * @param type
     * @return
     */
    @Override
    public InsStProductBase findByProductIdAndType(long productId,int type) {
        return baseMapper.findByProductIdAndType(productId,type);
    }

    /**
     * 根据productId 和 限制时间 生成统计值结果
     * @param productId
     * @param limitTime
     * @return
     */
    @Override
    public InsStProductBase findStResultByProductId(long productId, long limitTime) {
        return baseMapper.findStResultByProductId(productId,limitTime);
    }
}
